import 'package:flutter_test/flutter_test.dart';
import 'package:audio_waveforms/audio_waveforms.dart';
import 'package:audio_waveforms/audio_waveforms_platform_interface.dart';
import 'package:audio_waveforms/audio_waveforms_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:flutter/material.dart';
class MockAudioWaveformsPlatform
    with MockPlatformInterfaceMixin
    implements AudioWaveformsPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AudioWaveformsPlatform initialPlatform = AudioWaveformsPlatform.instance;

  test('$MethodChannelAudioWaveforms is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAudioWaveforms>());
  });

  test('getPlatformVersion', () async {
    final recorderController = RecorderController()
      ..androidEncoder = AndroidEncoder.aac
      ..androidOutputFormat = AndroidOutputFormat.mpeg4
      ..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC
      ..sampleRate = 44100;
    AudioWaveforms audioWaveformsPlugin = AudioWaveforms( enableGesture: true,
        size: Size(100,50),
        recorderController: recorderController,
        waveStyle: const WaveStyle(
          waveColor: Colors.white,
          extendWaveform: true,
          showMiddleLine: false,
        ),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(12.0),
          color: const Color(0xFF1E1B26),
        ),
        padding: const EdgeInsets.only(left: 18),
        margin: const EdgeInsets.symmetric(
            horizontal: 15));
    MockAudioWaveformsPlatform fakePlatform = MockAudioWaveformsPlatform();
    AudioWaveformsPlatform.instance = fakePlatform;

    expect(await AudioWaveformsPlatform.instance.getPlatformVersion(), '42');
  });
}
